import 'package:flutter/material.dart';

class WFOutlineButton extends StatelessWidget {

  final VoidCallback onPress;
  final Widget titleWidget;
  final Widget iconWidget;

  final double radius;
  final double borderSide;

  final Color borderColor;
  final Color backgroundColor;

  const WFOutlineButton({
    Key? key,
    required this.onPress,
    this.titleWidget = const SizedBox(),
    this.iconWidget = const SizedBox(),
    this.radius = 10000.0,
    this.borderSide = 2.0,
    this.borderColor = Colors.black,
    this.backgroundColor = Colors.transparent,
  }) : super(key: key);



  @override
  Widget build(BuildContext context) {
    return OutlinedButton.icon(
      // child: Text('$title',style: titleStyle!,),
      icon: iconWidget!,
      label: titleWidget!,
      style: ButtonStyle(
        backgroundColor: MaterialStateProperty.all(backgroundColor),
        side:MaterialStateBorderSide.resolveWith((states) => BorderSide(width: borderSide, color: borderColor),),
        shape: MaterialStateProperty.all(RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(radius)))),
      ),
      onPressed: (){
        onPress();
      },
    );
  }
}
